
<!doctype html>
<html lang="en">
<head>
<META HTTP-EQUIV="pragma" CONTENT="no-cache"> 
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate"> 
<META HTTP-EQUIV="expires" CONTENT="0">
<meta charset="UTF-8" />
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../../layui/css/layui.css" media="all">
<script src="../../../layui/layui.js" charset="utf-8"></script>
<script src="../../../js/angular.js" charset="utf-8"></script>
<script src="../../../layui/jquery-3.2.1.min.js" charset="utf-8"></script>
<script type="text/javascript" src="../gjjhbj/fy.js"></script>


	<link rel="stylesheet" href="../../../css/font_eolqem241z66flxr.css" media="all" />
	<link rel="stylesheet" href="../../../css/news.css" media="all" />
	<script type="text/javascript" src="../../../layui/layui/GetPath.js"></script>
	<script src="../../../layui/layui/layui.js" charset="utf-8"></script>
<style>
.layui-form-label {
	text-align: right;
}
.layui-form-item{
	height:30px;
	width:100%;
}
</style>


</head>
<body class="childrenBody">
	<div ng-app="myApp" ng-controller="customersCtrl" align="center">
<Loading></Loading>
			<div ng-hide="bj" style="width: 70%" id="xz">

			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">姓名:</label>
					<div class="layui-input-inline">
						<input type="text"  ng-model="XINGMINGb" readonly="readonly"
							id="XINGMING" autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">证件号码:</label>
					<div class="layui-input-inline">
						<input type="text"  ng-model="ZJHMb" id="ZJHM" readonly="readonly"
							autocomplete="off" class="layui-input">
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">手机号码:</label>
					<div class="layui-input-inline">
						<input type="text" ng-model="SJHMb" id="SJHM" autocomplete="off" readonly="readonly"
							class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">缴存基数:</label>
					<div class="layui-input-inline">
						<input type="text" readonly="readonly" ng-model="GRJCJSb"
							id="GRJCJS" autocomplete="off" class="layui-input">
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">个人比例:</label>
					<div class="layui-input-inline">
						<input type="text" readonly="readonly" ng-model="GRJCBLb"
							id="GRJCBL" autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">单位比例:</label>
					<div class="layui-input-inline">
						<input type="text" readonly="readonly" ng-model="DWJCBLb"
							id="DWJCBL" autocomplete="off" class="layui-input">
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">个人账号:</label>
					<div class="layui-input-inline">
						<input type="text" readonly="readonly" ng-model="GRZHb" id="GRZH"
							autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">性别:</label>
					<div class="layui-input-inline">
					<input type="text" readonly="readonly" ng-model="XINGBIE" id="XINGBIE"
							autocomplete="off" class="layui-input">
					</div>
				</div>
				
			</div>
			
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">单位缴存额:</label>
					<div class="layui-input-inline">
						<input type="text" ng-model="DWJCE" readonly="readonly" id="DWJCE" 
							autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">个人缴存额:</label>
					<div class="layui-input-inline">
					<input type="text" ng-model="GRJCE" readonly="readonly" id="GRJCE" 
							autocomplete="off" class="layui-input">
					</div>
				</div>
				
			</div>
		</div>
			
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">变更后单位缴存额:</label>
					<div class="layui-input-inline">
						<input type="text"   ng-model="BGHDWJCE" id="BGHDWJCE" ng-change="ch()"
							autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">变更后个人缴存额:</label>
					<div class="layui-input-inline">
					<input type="text"  ng-model="BGHGRJCE" id="BGHGRJCE" ng-change="ch()"
							autocomplete="off" class="layui-input">
					</div>
				</div>
				
			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">变更后基数:</label>
					<div class="layui-input-inline">
						<input type="text" readonly="readonly" ng-model="BGHJCJS"
							id="BGHJCJS" autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label"></label>
					<div class="layui-input-inline">
					</div>
				</div>
			</div>
			<div class="layui-form-item">
			<a href="javascript:void(0);" onclick="js_method()" class="layui-btn " style="width:10%;padding-left:10px;"  >选择文件</a>
			<i id="wj">
			</i>
				<input style="opacity:0;height:90%;hidden:hidden;width:0" type="file" name="file" multiple="multiple" id="filevideo" ng-change="ch()" ng-model="ch" class="layui-btn layui-btn-primary"  accept="image/*"  >
				<div class="layui-inline">
					<label class="layui-form-label"
						style="width: 130px;text-align: left;"> </label>
					<div class="layui-input-inline">
						<input type="button" class="layui-btn layui-btn-primary"
							id="submit" ng-click="submit()"value="确认更改">
					</div>
				</div>
				</div>
			</div>
			<br>
		</div>
</div>
	
	
	<script>
				layui.use('layer', function(){
  var layer = layui.layer;
  
});  
	</script>
	<script type="text/javascript">
		function getPath() {
			return 'http://' + location.host;
		}
		
		var app = angular.module('myApp', []);
		 app.directive('loading', function(){  
		        return {  
		            restrict: 'E',  
		            transclude: true,  
		            template: '<div ng-show="loading" class="loading" id="allDiv"  style="position:fixed; top:0px; left:0px; width:100%; height:100%; display:none; background-color:#000; opacity: 0.5; z-index:99999;">'  
		            +'<img alt="" src="../../../layui/layui/img/jz.gif" style="vertical-align: middle;width:30px; height:30px; position: absolute; top:50%; left:50%; margin-top: -50px; margin-left:-50px;"/>'
		            +'</div>',  
		            link: function (scope, element, attr) {  
		                scope.$watch('loading', function (val) {  
		                    if (val){  
		                        document.getElementById("allDiv").style.display = "block";  
		                    }else{  
		                        document.getElementById("allDiv").style.display = 'none';  
		  
		                    }  
		                });  
		            }  
		        };
		    }); 
		  app.controller('customersCtrl', function($scope, $http) {
		    $scope.setLoading =function(){  
			    if($scope.loading ==undefined || $scope.loading ==false){  
			        $scope.loading=true;  
			    }else{  
			        $scope.loading=false;  
			    };
			};
		  function getQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]); return null;
    }
  
		  var  GRZH= getQueryString('GRZH');
		  var  XINGMING= getQueryString('XINGMING');
		  var  JCQK= getQueryString('JCQK');
		  var  ZJHM= getQueryString('ZJHM');
		  var NIANYUE=getQueryString('NIANYUE');
		    console.info(NIANYUE);
		    $scope.setLoading();
		    	$http({
							url:getPath() + "/wsyyt/dwbjhjqccontroller/bgh",
							contentType:"text/html;charset=utf-8",
							method:'post',
							params:{ZJHM:ZJHM}
						})
					.then(function(res) {
					
					 if(res.data.msg==null)
								 {
								 	layer.msg("登陆失效请重新登陆");
									setTimeout(function () {
										window.top.location.href=res.data;
									}, 1500);
									return;
								 }
						var data = res.data.data;
						console.info(1);
						if(data.length>0&&data!=null){
						$("#BGHJCJS").val(data[0].BGHJCJS);
						$("#BGHGRJCE").val(data[0].BGHGRJCE);
						$("#BGHDWJCE").val(data[0].BGHDWJCE);
						}
					});
					
					$http({
							url:getPath() + "/wsyyt/dwbjhjqccontroller/bj",
							contentType:"text/html;charset=utf-8",
							method:'post',
							params:{GRZH:GRZH,JCQK:JCQK,XINGMING:XINGMING,ZJHM:ZJHM}
						})
					.then(function(res) {
					$scope.setLoading();
					 if(res.data.msg==null)
								 {
								 	layer.msg("登陆失效请重新登陆");
									setTimeout(function () {
										window.top.location.href=res.data;
									}, 1500);
									return;
								 }
						var data = res.data.data;
						console.info(1);
						if($("#BGHJCJS").val()==null||$("#BGHJCJS").val()=="")
						{
						$("#BGHJCJS").val(data[0].GRJCJS);
						$("#BGHGRJCE").val(data[0].GRJCE);
						$("#BGHDWJCE").val(data[0].DWJCE);
						}
						$.each(data[0], function(key, value) {
						
							$("#" + key).val(value || "");
						});	
					});
		  $scope.ch=function(){
		  	var GRJCE=$("#BGHGRJCE").val();
		  	var DWJCE=$("#BGHDWJCE").val();
		  	var GRJCBL=$("#GRJCBL").val();
		  	var DWJCBL=$("#DWJCBL").val();
		  	var ret=parseFloat(GRJCE)+parseFloat(DWJCE);
			var str=parseFloat(GRJCBL)+parseFloat(DWJCBL);
		  	var gzjs=parseFloat(parseFloat(ret) * 100 / parseFloat(str)).toFixed(2)//工资基
		  	$("#BGHJCJS").val(gzjs);
		  	}
		  $scope.submit=function() {
			if($("#filevideo").get(0).files[0]==null){
			layer.alert('提示：请选择上传文件', {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 5    // icon
								     ,btn2:function(){
										
								     }});	
								     return;
								     }
			var XINGMING=$("#XINGMING").val();
			var ZJHM=$("#ZJHM").val();
			var SJHM=$("#SJHM").val();
			var GRJCJS=$("#BGHJCJS").val();
			var GRJCBL=$("#GRJCBL").val();
			var DWJCBL=$("#DWJCBL").val();
			var GRZH=$("#GRZH").val();
			var XINGBIE=$("#XINGBIE").val();
			var GRJCE=$("#BGHGRJCE").val();
			var DWJCE=$("#BGHDWJCE").val();
			if(true ){
			 $scope.setLoading();
			 	$http({
							url:getPath()+"/wsyyt/dwbjhjqccontroller/bgjs",
							contentType:"text/html;charset=utf-8",
							method:'post',
							params:{XINGMING:XINGMING,GRZH:GRZH,SJHM:SJHM,GRJCJS:GRJCJS,GRJCBL:GRJCBL,DWJCBL:DWJCBL,ZJHM:ZJHM,XINGBIE:XINGBIE,GRJCE:GRJCE,DWJCE:DWJCE,NIANYUE:NIANYUE}				
						})
					.then(function(res) {
					var ID=res.data.data.ID;
					 if(res.data.msg==null)
								 {
								 	layer.msg("登陆失效请重新登陆");
									setTimeout(function () {
										window.top.location.href=res.data;
									}, 1500);
									return;
								 }
						$scope.setLoading();
						if(res.data.msg=='成功'){
						
						layer.alert('提示：'+res.data.msg, {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 6    // icon
								     ,btn2:function(){
										
								     }});
								     }
					     else{
									layer.alert('提示：'+res.data.msg, {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 5    // icon
								     ,btn2:function(){
										
								     }});
								     return;
								     }
								     
								     	$scope.setLoading();
			  var fd=new FormData();  
	   $http({
		        url: getPath() + "/wsyyt/dwbjhjqccontroller/tpsc",
				method: 'POST',
				headers: {
				'Content-Type': undefined
				},
				transformRequest: function() {
				var formData = new FormData();
				var temp = [];
				console.info($("#filevideo").get(0).files.length);
				for(var i=0;i<$("#filevideo").get(0).files.length;i++ ){
					temp.push($("#filevideo").get(0).files[i]);
				}
				$.each(temp,function(i,file){
				  formData.append('files',file);
				}); 
				formData.append("yid",ID);
				formData.append("isphoto","0");
				formData.append("ftype","1");
				formData.append("btype","28");
				formData.append("ytype","1");
				formData.append("uid","123445678901");
				return formData;
				}
				})
					.then(
							function(data) {
							
							 fileurl=data.data;
							$scope.setLoading();
							data=data.data;
	         if(data.length==0||data==null){
	         	layer.alert('提示：成功', {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 6    // icon
								     ,btn1:function(){
										window.location.reload();
								     }});	
	         	}
	         else
	         	{
	         	var myArray=new Array();
	         		for(var i=0;i<data.length;i++){
	         			myArray.push(data[i].msg);
	         		}
	         		var cc=JSON.stringify(myArray);
	         		layer.open({
  title: '错误信息'
  ,content: cc
});     
	         	}
			});	
					});
				/* $.ajax({
							url : getPath()+'/wsyyt/dwbjhjqccontroller/qrbj',
							method : 'post',
							dataType : 'JSON',
							data: {'XINGMING':XINGMING,'GRZH':GRZH,'SJHM':SJHM,'GRJCJS':GRJCJS,'GRJCBL':GRJCBL,'DWJCBL':DWJCBL,'ZJHM':ZJHM,},
							success : function(res) {
							 $scope.setLoading();
									layer.msg('提示：'+res.msg);		
										window.setTimeout("window.location.reload();",1500);
							}
					});	 */
			}else{
				layer.alert("手机号码不满足十一位");
			};
			 
		};
		  })
		  $("#filevideo").change(function(){
			if($("#filevideo").get(0).files.length){
				var arr  = [];
				for(var i =0 ; i < $("#filevideo").get(0).files.length ; i++){
					arr.push($("#filevideo").get(0).files[i].name)
				}
				document.getElementById('wj').innerHTML=arr.join(",");
			}else{
				$("#wj").text("");
			}
			});
		function js_method(){
				$('#filevideo').trigger("click");
			}
			
			
	$("#ck").click(function(){
		layer.open({ 
type: 2,  
 title: '查看上传图片',
area: ['100%', '100%'],
content: getPath()+'/wsyyt/dwwsyyt/dw/gjjhbj/tp1.html' //这里content是一个URL,如果不显示滚动条就使用上面content: ['test/guodu.html', 'no']
});
	})
	</script>
	<script type="text/javascript"
		src="../../../layui/lay/modules/layer.js"></script>
	<script type="text/javascript" src="../../../layui/layui/layer.ext.js"></script>
	<script src="../../../layui/jquery-3.2.1.min.js" charset="utf-8"></script>
	<script type="text/javascript" src="../../../js/log.js"></script>
	<script type="text/javascript">
			

	</script>
</body>
</html>